package com.kerpow.KSheet.character;

import java.util.List;

import com.kerpow.KSheet.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class SkillAdapter extends ArrayAdapter<Stat> {

	public SkillAdapter(Context context, int textViewResourceId,
			List<Stat> objects) {
		super(context, textViewResourceId, objects);
	}
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		Stat s = this.getItem(position);
		View v = convertView;
		if(v == null){
			LayoutInflater inflater = (LayoutInflater)this.getContext().getSystemService ( Context.LAYOUT_INFLATER_SERVICE);
			v = inflater.inflate(R.layout.skill_row, null);

		}
		
		TextView t = (TextView) v.findViewById(R.id.skill_row_name);
		t.setText(s.Name);		

		t = (TextView) v.findViewById(R.id.skill_row_value);
		t.setText(s.Value);
		
		return v;
	}
}
